package com.snopy.designPattern.create.simpleFactory;

import com.snopy.designPattern.create.abstractFactory.AbstractFactory;
import com.snopy.designPattern.create.simpleFactory.impl.Barge;
import com.snopy.designPattern.create.simpleFactory.impl.Dugout;
import com.snopy.designPattern.create.simpleFactory.impl.Kayak;

/**
 * @author snopy
 * @version 1.0.0
 * @classname SimpleShipFactory
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/01 14:26
 */
public class SimpleShipFactory extends AbstractFactory {
    @Override
    public Car getCar(String carName) {
        return null;
    }

    @Override
    public Ship getShip(String shipName) {
        Ship ship = null;
        if (shipName.equalsIgnoreCase("DUGOUT")){
            ship = new Dugout();
        }else if(shipName.equalsIgnoreCase("BARGE")){
            ship = new Barge();
        }else if (shipName.equalsIgnoreCase("KAYAK")){
            ship = new Kayak();
        }
        return ship;
    }
}
